# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-qt5
pkgver=5.15.10
pkgrel=1
pkgdesc="A set of Python 3 bindings for the Qt toolkit"
url="https://www.riverbankcomputing.com/software/pyqt/"
arch="all"
license="GPL-3.0-only"
depends="
	py3-pyqt5-sip
	python3
	"
makedepends="
	libx11-dev
	py3-dbus-dev
	py3-opengl
	py3-pyqt-builder
	py3-sip
	python3-dev
	qt5-qtbase-dev
	qt5-qtconnectivity-dev
	qt5-qtdeclarative-dev
	qt5-qtlocation-dev
	qt5-qtmultimedia-dev
	qt5-qtserialport-dev
	qt5-qtsvg-dev
	qt5-qttools-dev
	qt5-qtwebchannel-dev
	qt5-qtwebsockets-dev
	qt5-qtx11extras-dev
	"
subpackages="$pkgname-dbg $pkgname-pyc"
source="https://pypi.python.org/packages/source/P/PyQt5/PyQt5-$pkgver.tar.gz"
builddir="$srcdir/PyQt5-$pkgver"

build() {
	export CFLAGS="$CFLAGS -O2 -flto=auto"
	export CXXFLAGS="$CXXFLAGS -O2 -flto=auto"
	sip-build \
		--confirm-license \
		--qmake /usr/lib/qt5/bin/qmake \
		--api-dir /usr/share/qt5/qsci/api/python \
		--pep484-pyi \
		--no-make
	make -C build
}

check() {
	make -C build check
}

package() {
	make DESTDIR="$pkgdir" INSTALL_ROOT="$pkgdir" -C build install -j1
	python3 -m compileall -j 0 "$pkgdir"/usr/lib/python3*
}

sha512sums="
e62debe112210b68993377264448199b66a43fc5db13c583a25e210759f5cd945bd1056c1c19fb86bcf005c6904358dfb89e005d27167a349f1d55987a63013e  PyQt5-5.15.10.tar.gz
"
